package com.github.codemperor.core.message.dingtalk.robot.bean;

/**
 * 文本类型机器人消息
 */
public class MarkdownMsgRequest extends BaseRobotMsg {

    private Markdown markdown;

    public Markdown getMarkdown() {
        return markdown;
    }

    public void setMarkdown(Markdown markdown) {
        this.markdown = markdown;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"markdown\":")
                .append(markdown);
        sb.append(",\"msgtype\":\"")
                .append(msgtype).append('\"');
        sb.append(",\"at\":")
                .append(at);
        sb.append('}');
        return sb.toString();
    }

    public static class Markdown {
        /**
         * 消息title
         */
        private String title;
        /**
         * 消息title
         */
        private String text;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("{");
            sb.append("\"title\":\"")
                    .append(title).append('\"');
            sb.append(",\"text\":\"")
                    .append(text).append('\"');
            sb.append('}');
            return sb.toString();
        }
    }
}
